package cn.bdqn.study_method;

import java.util.Scanner;

//菜单类
/**
 * Menu菜单类，完成购物系统的菜单显示及切换
 * @author admin
 * @version  1.0.0
 * */
public class Menu {

    //将input声明为成员变量，在本类的所有方法中都能使用
    Scanner input = new Scanner(System.in);

    //登陆菜单
    public void showLoginMenu(){
        do {
            System.out.println("欢迎进入购物系统：");
            System.out.println("1、登陆");
            System.out.println("2、退出");
            System.out.println("请选择：");
            int number = input.nextInt();
            switch (number){
                case 1:
                    showMainMenu();
                    break;
                case 2:
                    System.out.println("系统退出！");
                    return;
            }
            System.out.println("是否继续（y/n）？");
            String isY = input.next();
            if(isY.equals("n")){
                break;
            }
        }while(true);

    }

    //主菜单
    public void showMainMenu(){

        do{
            System.out.println("欢迎进入系统：");
            System.out.println("1、客户管理");
            System.out.println("2、真情回馈");
            System.out.println("请选择：");
            int number = input.nextInt();
            switch (number){
                case 1:
                    showCustMenu();
                    break;
                case 2:
                    showSendMenu();
                    break;
                case 0:
                    return;
            }

        }while(true);

    }

    //客户管理菜单
    public void showCustMenu(){
        System.out.println("客户管理菜单：");
    }

    //真情回馈菜单
    public void showSendMenu(){
        System.out.println("真情回馈菜单：");
    }

}
